package org.example.common.configs.mail;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @author weigang
 * @create 2022-10-27 16:11
 */
@Slf4j
@Component
public class AsyncMailHelper {
    @Async("emailPool")
    public void send(SendMailFunction sendMailFunc) {

        try {
            sendMailFunc.sendMail();
        } catch (Exception e) {
            log.error("发送邮件异常", e);
        }
    }
}
